namespace Framework.Network
{
    public class SocketMessage
    {
        public SocketMessageType MessageType { get; }
        public int ConnectId { get; }
        public int SessionId { get; }
        public NetBuffer Data { get; }

        public SocketMessage(int connectId, SocketMessageType messageType, NetBuffer data, int sessionId)
        {
            ConnectId = connectId;
            MessageType = messageType;
            Data = data;
            SessionId = sessionId;
        }

        public SocketMessage(int connectId, SocketMessageType messageType, byte[] data, int sessionId)
        {
            ConnectId = connectId;
            MessageType = messageType;
            Data = new NetBuffer(data, 0, data.Length);
            SessionId = sessionId;
        }
    }
}